﻿using System.Collections.Generic;
using Model = DTcms.Model;
using BLL = DTcms.BLL;
using DTcms.Web.Mvc.UI;
using System.Data;

namespace System.Web.Mvc.Html
{
    public static class HtmlHelperCategory
    {
        public static BaseController _base = new BaseController();
        /// <summary>
        /// 返回当前类别名称
        /// </summary>
        /// <param name="category_id">类别ID</param>
        /// <returns>String</returns>
        public static string get_category_title(this HtmlHelper htmlHelper, int category_id)
        {
            return get_category_title(htmlHelper, category_id, string.Empty);
        }

        /// <summary>
        /// 返回指定类别的上一级ID
        /// </summary>
        /// <param name="category_id">类别ID</param>
        /// <returns>DataTable</returns>
        public static int get_category_parent_id(this HtmlHelper htmlHelper, int category_id)
        {
            return _base.get_category_parent_id(category_id);
        }

        /// <summary>
        /// 返回当前类别名称
        /// </summary>
        /// <param name="category_id">类别ID</param>
        /// <param name="default_value">默认名称</param>
        /// <returns></returns>
        public static string get_category_title(this HtmlHelper htmlHelper, int category_id, string default_value)
        {
            return _base.get_category_title(category_id, default_value);
        }

        /// <summary>
        /// 返回当前类别内容
        /// </summary>
        /// <param name="category_id">类别ID</param>
        /// <param name="default_value">默认名称</param>
        /// <returns></returns>
        public static string get_category_content(this HtmlHelper htmlHelper, int category_id, string default_value)
        {
            return _base.get_category_content(category_id, default_value);
        }

        /// <summary>
        /// 返回类别导航面包屑
        /// </summary>
        /// <param name="urlKey">URL重写Name</param>
        /// <param name="category_id">类别ID</param>
        /// <param name="mark">标记</param>
        /// <returns>String</returns>
        public static string get_category_menu(this HtmlHelper htmlHelper, string urlKey, int category_id, string mark)
        {
            return _base.get_category_menu(urlKey, category_id, mark);
        }

        /// <summary>
        /// 返回指定类别下列表 List<T>
        /// </summary>
        /// <param name="channel_name"></param>
        /// <param name="parent_id"></param>
        /// <param name="top"></param>
        /// <returns></returns>
        public static List<Model.article_category> get_category_child_list(this HtmlHelper htmlHelper, string channel_name, int parent_id, int top)
        {
            return _base.get_category_child_list(channel_name, parent_id, top);
        }

        /// <summary>
        /// 返回类别列表
        /// </summary>
        /// <param name="channel_name">频道名称</param>
        /// <param name="parent_id">父类别ID</param>
        /// <returns>DataTable</returns>
        public static DataTable get_category_list(this HtmlHelper htmlHelper, string channel_name, int parent_id)
        {
            return _base.get_category_list(channel_name, parent_id);
        }

        /// <summary>
        /// 返回指定类别同级列表
        /// </summary>
        /// <param name="channel_name">频道名称</param>
        /// <param name="category_id">当前类别ID</param>
        /// <returns>DataTable</returns>
        public static DataTable get_category_current_list(this HtmlHelper htmlHelper, string channel_name, int category_id)
        {
            return _base.get_category_current_list(channel_name, category_id);
        }

        /// <summary>
        /// 返回类别一个实体类
        /// </summary>
        /// <param name="category_id">类别ID</param>
        /// <returns>Model.category</returns>
        public static Model.article_category get_category_model(this HtmlHelper htmlHelper, int category_id)
        {
            return _base.get_category_model(category_id);
        }

        /// <summary>
        /// 返回指定类别下列表(一层)
        /// </summary>
        /// <param name="channel_name">频道名称</param>
        /// <param name="parent_id">父类别ID</param>
        /// <returns>DataTable</returns>
        public static DataTable get_category_child_list(this HtmlHelper htmlHelper, string channel_name, int parent_id)
        {
            return _base.get_category_child_list(channel_name, parent_id);
        }

        /// <summary>
        /// 返回指定类别的父节点ID
        /// </summary>
        /// <param name="category_id">类别ID</param>
        /// <returns>int</returns>
        public static int get_category_parent_first_id(this HtmlHelper htmlHelper, int category_id)
        {
            return _base.get_category_parent_first_id(category_id);
        }
    }
}